<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<title>Administration</title>    
    <?php echo javascript_defaults()?>
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/css/forms.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/css/admin.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    
    <!-- sortable columns -->
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/js/sortabletable/css/sortabletable.css" type="text/css" media="screen" />
    <script src="<?php echo get_installed_path() ?>/js/sortabletable/js/sortabletable.js" type="text/javascript" language="javascript" charset="utf-8"></script>
    
    <script type="text/javascript" charset="utf-8">
        // used by tincymce as a callback
        function pixelFileBrowser (field_name, url, type, win) {
            var picker_url;
            if (type=="file") {
                picker_url = '<?php echo get_installed_path(); ?>/admin/pages/js_list';
            } else {
                picker_url = '<?php echo get_installed_path(); ?>/admin/files/browse' + "?files_filter_by=" + type;
            }
           tinyMCE.openWindow({
               file : picker_url,
               title : "File Browser",
               width : 600,  
               height : 400,
               close_previous : "no"
           }, {
               window : win,
               input : field_name,
               resizable : "yes",
               inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
               editor_id : tinyMCE.getWindowArg("editor_id")
           });
           return false;
         }
    </script>

	<!-- layout_head_style -->
    <?php
 	// added js files or css
	if(!empty($content_for_head)) 
	{
		echo $content_for_head;
	}
	?>
</head>
<body>
<div id='hd-container'>
    <div id='hd'>
		<div class='yui-ge'>
        	<div class='yui-u first'>
				<h1>Website Administration for: <?php echo $_SERVER['HTTP_HOST'] ?></h1>
	        </div>
			<div class='yui-u'>
			    <div id="top-nav">
<?php echo link_to('Logout',
                    array('controller'=>'login',
                          'action'=>'logout'),
                    array('id'=>'logout'))?>
<?php echo link_to('Your Profile',
                    array('controller'=>'admin/users',
                          'action'=>'profile'),
                    array('id'=>'profile'))?>
<?php echo link_to('View Site &raquo;',
                    get_installed_path().'/content',
                    array('id'=>'view_site'))?>
			    </div>
			</div>
		</div>
		<div id="nav" class='yui-b'>
	        <ul>
	            <li><?php echo link_to('Dashboard',array('controller'=>'admin/dashboard'))?></li>
	            <?php if (has_access_to('Admin::Access Admin')) {?><li><?php echo link_to('Admin',array('controller'=>'admin/users'))?></li><?php } ?>
	            <?php if (has_access_to('Pages::Access Pages')) {?><li><?php echo link_to('Pages',array('controller'=>'admin/pages'))?></li><?php } ?>
	            <?php if (has_access_to('News::Access News')) {?><li><?php echo link_to('News',array('controller'=>'admin/news'))?></li><?php } ?>	           
	            <?php if (has_access_to('Files::Access Files')) {?><li><?php echo link_to('Files',array('controller'=>'admin/files'))?></li><?php } ?>
	            <?php if (has_access_to('Inbox::Access Inbox')) {?><li><?php echo link_to('Inbox',array('controller'=>'admin/inbox'))?></li><?php } ?>
	        </ul>
	    </div>
    </div>
</div>
<div id='nv-extra'></div>
<div id='subnav-container'>
	<div id='subnav'>
		<?php
			if ( !empty($subnav) && is_array($subnav) )
			{
				echo '<ul>';
				foreach( $subnav as $_p => $_l )
				{
					printf("<li>%s</li>",link_to($_p,$_l));
				}
				echo '</ul>';
			}
		?>
	</div>
</div>

<?php echo busy_image() ?>  
    
<div id='doc3'>
	<div id='bd'> 
		<div id="all_messages">       
	        <?php
	            if ( $msg = flash('notice') )
	            {
	                echo "<div id='success_notices' class='flash_notice' style='display:none'>$msg</div>";
	                echo "<script>Effect.toggle('success_notices', 'appear');setTimeout(\"new Effect.Fade('success_notices')\",3000)</script>";
	            }
	            if ( $msg = flash('error') )
	            {
	                echo "<div class='flash_error' id='error_notices' style='display:none'>$msg</div>";
	                echo "<script>Effect.toggle('error_notices', 'appear');setTimeout(\"new Effect.Fade('error_notices')\",6000)</script>";
	            }
	        ?>
	        <div id='success_messages' class='flash_notice' style='display:none'></div>
	        </div>
        
	        <?php echo $content_for_layout?>
	    </div>
	</div>
</div>

<div id="ft">
	&copy; 2005 - <?php echo date("Y") ?> thebusypixel.com
</div>
    
</body>
</html>
